;(function($){
	this.myProperty = function(){
		
		var chooseHongbao;//我的红包页面的可用红包页历史红包按钮
		var hongbaoContainer;//红包容器
		var exchangeBtn;//兑换红包按钮
		var exchangeWrapper;//兑换红包弹出层
		var closeBtn;//兑换红包弹出层的关闭按钮
		var selectBlock;//账户余额页面的资产明细个小项按钮
		
		var initData = function(){
			
		};
		
		var loadEvent = function(){
			chooseHongbao.on('click',disHongbao);//可用红包页历史红包切换
			
			//弹出兑换红包层
			exchangeBtn.on('click',function(){
				$('body').append('<div class="blackbox"></div>');
				exchangeWrapper.show();
			});
			
			//关闭兑换红包层
			closeBtn.on('click',function(){
				$('.blackbox').remove();
				exchangeWrapper.hide();
			});
			
			//点击时按钮自己变蓝
			selectBlock.on('click',function(){
				selectBlock.removeClass('active');
				$(this).addClass('active');
			})
			
			
		};
		
		//可用红包页历史红包切换
		var disHongbao = function(){
			chooseHongbao.removeClass('active');
			$(this).addClass('active');
			hongbaoContainer.hide();
			if(this.innerHTML === chooseHongbao[0].innerHTML){
				$(hongbaoContainer[0]).show();
			}else{
				$(hongbaoContainer[1]).show();
			}
		}
		
		return {
			run: function(){
				chooseHongbao = $('.hongbao .tabnavigation-navitem');
				hongbaoContainer = $('.hongbao-container');
				exchangeBtn = $('.hongbao-exchangebtn');
				exchangeWrapper = $('.exchangedialog.dialog');
				closeBtn = $('.hongbao .dialog-close');
				selectBlock = $('.selector-content .selector-item');
				initData();
				loadEvent();
			}
		}
	}();
	
})(jQuery);
